// import * as actionTypes from "./constants"

// const initialState = {
//     ticketInfo:{
//         ticketName: "亲子票",
//         singleNum: 3,
//         quantity: 3,
//         price: 39900,
//         bookStartTime: "2024-11-01 00:00:00",
//         bookEndTime: "2024-12-09 23:59:59",
//         validStartTime: "2024-12-10 09:00:00",
//         validEndTime: "2024-12-10 18:00:00",
//         description: "亲子票，适合带孩子的家庭。",
//         isOnSale: 0
//     }
// }

// function reducer(state = initialState, action) {
//   switch (action.type) {
//     case actionTypes.ADD_TICKET:
//         return { ...state, ticketInfo: {...state.ticketInfo}}
//     default:
//       return state
//   }
// }

// export default reducer

const   ADD = 'ADD'
const MINUS = 'MINUS'
const INITIAL_STATE = {
    num: 0
  }
  
  export default function counter (state = INITIAL_STATE, action) {
    switch (action.type) {
      case ADD:
        return {
          ...state,
          num: state.num + 1
        }
      case MINUS:
        return {
          ...state,
          num: state.num - 1
        }
      default:
        return state
    }
  }


